Problem inserting in two different tables [closed]

Posted by imvarunkmr on Programmers See other posts from Programmers or by imvarunkmr
Published on 2012-11-03T11:22:40Z Indexed on 2012/11/03 17:21 UTC
Read the original article Hit count: 112

Filed under:
|

I have written an insert statement which inserts a record into Table1.

Table1 has a column "ID" which is an auto_increment(Identity) primary key.

How can I fetch the newly generated "ID" and as I need to Insert this value as foreign key in Table2?

Note : I have written INSERT statement in a stored procedure and I am calling this procedure using C#

Alternative suggestions to link both tables are also welcomed :)

© Programmers or respective owner

Related posts about c#

Related posts about sql-server